0

I am having some trouble applying individual cell widths. There's a 1x2 (1 row, 2 col) table in my code. The 1st cell has just links, while the other has an iframe. Because I had to style the first cell different, I used a selector. The CSS for the 1st cell/column follows:

.alleft {
    text-align: left;
    font-family: Arial;
    font-size: 14pt;
    font-weight: bold;
    width: 150px;
    }

iframe {
    float: right;
    width: 550px;
    height: 455px;
    }

table {
    width: 700px;
    margin:0 auto;
    }

The relevant html may be:

<table>
 <tr>
 <td class="alleft"> 
  <h3> The Paintings of Picasso </h3>
   <a href="absinth.jpg"> The Absinth Drinker </a>
 </td>
 <td>
  <iframe src="picasso.html" name="iframe" id="iframe" scrolling="auto" frameborder="0">
  </iframe>
 </td>
 </tr>
</table>

Sorry if that looks insane! Wasn't too sure if I included too much or too little.

1
  • 1
    Relevant HTML is essential for CSS/HTML questions, please share that as well. May 23, 2014 at 20:32

1 Answer 1

0

Without more code, there isn't much to go on here, so these are my guesses.

Could be one of two things:

  1. Is this table contained within another div/container that has a set width? Possible that iframe + 1st cell are too wide for set width.

  2. You can set a max-width: x; for the iframe, and a min-width: 150px; for the cell one. Play around with those numbers for each width and you should get something that works.

Example:

.alleft {
    text-align: left;
    font-family: Arial;
    font-size: 14pt;
    font-weight: bold;
    min-width: 150px;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.