Jump to content

Help with colspan, ahhhhhhhhhhh!


DataSpy

Recommended Posts

I'm wondering if it's possible to have one row in a table have one column, another row have 3 columns, and a third row have two columns?

 

row 1 = 1 col

row 2 = 3 col

row 3 = 2 col

 

example on my website here == http://www.data-spy.net/columns.html

 

as you can see in the example the last column doesn't go all the way over :(

 

<html>
<head>
<title>Columns suck!</title>
</head>
<body>
<table width="50%" border="1">
<tr>
   <td colspan="3">
   row 1 - 1 column - c1
   </td>
</tr>
<tr>
   <td>
   row 2 - 3 columns - c1
   </td>
   <td>
   c2
   </td>
   <td>
   c3
   </td>
</tr>
<tr colspan="2">
   <td>
   row 3 - 2 columns - c1
   </td>
   <td>
   c2
   </td>
</tr>
</table>
</body>
</html>

 

Any help greatly appreciated, thanks in advance!!!!!!!!!!!!!

Link to comment
Share on other sites

In the third row, you could change the colspan to 3.

 

Or you could put the first td to colspan 2 and the second td to 1.

 

Sometimes it is better to put the colspan attribute into the td rather than tr, but it depends on what you're looking for and how you want the cells to be spaced out.

Link to comment
Share on other sites

Colspan 3 in row 1 and colspan 2 in row 3.

 

<table width="50%" border="1">

<tr>

  <td colspan="3">

  row 1 - 1 column - c1

  </td>

</tr>

<tr>

  <td>

  row 2 - 3 columns - c1

  </td>

  <td>

  c2

  </td>

  <td>

  c3

  </td>

</tr>

<tr colspan="2">

  <td>

  row 3 - 2 columns - c1

  </td>

  <td colspan="2">

  c2

  </td>

</tr>

</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.