By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,830 Members | 2,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,830 IT Pros & Developers. It's quick & easy.

Wrap content in a <tr> tag to a new line

P: 1
I cant figure out how to wrap the content to a new row when it exceeds the width of the page?

Here is a link to what I have so far and the first question in this survey has more color swatches than is visible. I need these color chips to move to a new line so that they are all visible.

Here is what I have:

Expand|Select|Wrap|Line Numbers
  1. $return .= '<table class="table_question">';
  2.         $return .=       '<tr>';
  3.         $return .=            '<td class="'.$question_class.'">';
  4.         $return .=           $question_details["0"]["title"];
  5.         if($question_details["0"]["required"] == "1"){
  6.             $return .= '<span class="question_required"> *</span>';
  7.             $javascript = ' onchange="setentertext(form.q'.$question_id.', this)" ';
  8.             $validation = $this->createValidation($question_id, $question_details["0"]["title"]);                    
  9.         }
  10.         $return .=            '</td>';
  11.         $return .=       '</tr>';
Nov 29 '11 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 5K+
P: 9,731
Create a row with one table data "<td>" element for where you want the wrapping to occur.

Your items should wrap.

Nov 29 '11 #2

Expert 5K+
P: 7,435
I'd bet he wants it to wrap as the browser is resized and that's not going to happen. Reason #9736 why you should never use tables for layout.
Nov 29 '11 #3

P: 1,059
you should also take a look at css property overflow
Nov 30 '11 #4

P: 638
hi ,
you can use jquery to get the body / screen width on run time
Expand|Select|Wrap|Line Numbers
  1. var dimX    =    $(document.body).width();
  2. var dimY    =    $(document.body).height();
and assign that width to the table or td to go on with the
screen resolution , i dont think it is impossible to do drhowarddrfine that you go bet on it ;)
Omer Aslam
Dec 1 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.