Why is it that when I split a table into different rows they will only get about 10 pixels in height from eachother unless I put an object smaller than that in the space? How can I make that space about 3 pixels? Preferably using css.

Dani AI

Generated

For : the easiest, CSS-friendly way to control the gap between cells is border-spacing (it sets the space between columns and rows). If your table uses border-collapse: collapse, border-spacing is ignored — switch to separate first. Example for a 3px vertical gap between rows:

table {
  border-collapse: separate;
  border-spacing: 0 3px;   /* horizontal vertical */
}
td { padding: 6px; }       /* cell inner padding, adjust as needed */

Note: the first value of border-spacing controls horizontal gaps (between columns); the second controls vertical gaps (between rows). See the spec and browser notes at MDN: border-spacing and MDN: border-collapse.

A couple of practical points tied to the replies here: is right that inline CSS will work, but putting this in a stylesheet or a class is cleaner. s border trick (adding a border on a td to create a gap) can work visually, but it is a layout hack and depends on color/backups; border-spacing gives a true gap and is preferable. If Dreamweaver inserted cellpadding/cellspacing, those are obsolete — prefer the CSS approach and check the generated HTML/CSS for resets that might force border-collapse: collapse (MDN: table element).

Why is it that when I split a table into different rows they will only get about 10 pixels in height from eachother unless I put an object smaller than that in the space? How can I make that space about 3 pixels? Preferably using css.

Apply inline CSS you will get it

my suggestion is

table tr td{
       border-left:10px solid #FFF;
}

you can change border color on whatever you need, same way you can make spacing top or bottom or right, gl

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.