Jump to content

Issues with spacing table cells.


creata.physics

Recommended Posts

Hi, I'm having an issue with html here. What I'm trying to do is have one row of my table have 0 cellspacing, but have all other rows have a 1px cellspacing.

 

So basically, I'd have a table like this:

Row Title 0 Cellspacing

Row Title 0 Cellspacing

Row Result 1 Cellspacing

Row Result 1 Cellspacing

 

I've tried to separate the two tables, by doing:

 

<table>
<tr><td>Titles here</td></tr>
</table>
<table>
<tr><td>Results here</td></tr>
</table>

 

But even if you set the same widths on each one, depending on how much content is in each row, and what browser they are using, it could be very misaligned.  I've messed with border-spacing in css and found you can only set the spacing horizontally or vertically, not the top, bottom, left or right.

 

If anybody has any tips to help me solve this that would be great, thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/231737-issues-with-spacing-table-cells/
Share on other sites

I tried this - A two row table with a table in each row. Three total. You can play with it and see what you get. I left the borders set at 1 and it checks out in IE8.

<table width="300" border="1" cellspacing="10px" cellpadding="0">
<tr>
	<td>
	<table width="300" border="1" cellspacing="0px" cellpadding="20px">
		<tr>
			<td >help title</td>
			<td>word title</td>
			<td>image title</td>
		</tr>
	</table></td>
</tr>
<tr>
	<td>
		<table width="300" border="1" cellspacing="10px" cellpadding="0" style="text-align:center;">
			<tr>
				<td>help</td>
				<td>word</td>
				<td>image</td>
			</tr>
			<tr>
				<td>help</td>
				<td>word</td>
				<td>image</td>
			</tr>
			<tr>
				<td>help</td>
				<td>word</td>
				<td>image</td>
			</tr>
			<tr>
				<td>help</td>
				<td>word</td>
				<td>image</td>
			</tr>
			<tr>
				<td>help</td>
				<td>word</td>
				<td>image</td>
			</tr>
		</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.