8 replies [Last post]
gary4u
gary4u's picture
Offline
Regular
India
Last seen: 11 weeks 13 hours ago
India
Timezone: GMT+5.5
Joined: 2018-12-31
Posts: 15
Points: 23

Hi,

Need help for text wrap in a colum for desktop and mobile.

I am using this code for displaying the data from the database -

						$des=  str_replace( "\'","'", 
                                                 $row["description"]);
						echo $des;

The data is displaying very well in both desktop and in mobile. BUT in MOBILE the text goes out side of the grid.

Can any one please help me in this regard

Thanks

Gary

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 39 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9738
Points: 3817

html/css source

Where can we see the actual html and css as the browser sees it?

g

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gary4u
gary4u's picture
Offline
Regular
India
Last seen: 11 weeks 13 hours ago
India
Timezone: GMT+5.5
Joined: 2018-12-31
Posts: 15
Points: 23

Sir, I have no idea how to

Sir,

I have no idea how to show you the code - but this is the web link - http://myshop.clysarts.com/productmain.php?id=28

The php code is inserted in the html file.

If you scroll below the page you will see a

TAB

Description / Additional information

In this Tab the description is shown.

Please let me know if there is any other way to for to view the complete code.

THanks

Gary

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 39 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9738
Points: 3817

At first glance

See this?

Quote:

                                                                                                                                                                             

Never do this. By never, I mean not ever. Notice there are no word spaces on which to break the line. This occurs within a table element, so the entire column width expands. If you intend to create white space, the padding property is the proper way to do it.

I notice that you are apparently using MS Office to build the page and exporting to html. That is a bad idea. I think that is the cause of the non breaking spaces, their way of padding. Stupid. See this:

<table border="0" 
       cellpadding="0" 
       cellspacing="0" 
       width="243" 
       style="width: 182pt;">
  <tbody>
    <tr height="179" 
        style="mso-height-source:userset;
               height:134.25pt">
      <td height="179" 
          class="xl65" 
          width="243" 
          style="height:134.25pt;
                 width:182pt">

Notice the widths using a pt metric. Point measures are for print (which is what MSO is designed for) and is a completely inappropriate metric for html. Always write your source in a plain text editor. Use a monospace font and format for ease of reading by the Mark I human eyeball. Compare my reformatted snippet above to your source code. To see your code as the browser sees it, open the page and type ctl-u to open the source in a new tab or window.

I think undoing MSO's bs will get you much closer to what you want. If the fix isn't complete, the next error will at least be incrementally easier to find.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gary4u
gary4u's picture
Offline
Regular
India
Last seen: 11 weeks 13 hours ago
India
Timezone: GMT+5.5
Joined: 2018-12-31
Posts: 15
Points: 23

Respected Sir, FYI This is

Respected Sir,

FYI

This is purely and I mean purely HTML and CSS there is no use of any kind of MS Office used.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 39 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9738
Points: 3817

See this

Where did this come from:

style="mso-height-source:userset;

Also, did you add all those non-breaking spaces? Or, did you use point metrics?

Did removing all those &nbsp; help with the overflow issue?

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gary4u
gary4u's picture
Offline
Regular
India
Last seen: 11 weeks 13 hours ago
India
Timezone: GMT+5.5
Joined: 2018-12-31
Posts: 15
Points: 23

Hi, GOD , Sir you are. Thank

Hi,

GOD , Sir you are.

Thank you for pointing this out. This will be the cause. I'm giving the website owner a separate Admin section where he can upload, edit and update all his Products & details to his website , it is here I have provided him this tool to be used as his details need to come in a format will be displayed on the webpage.

Need to do something about this. As the Project is nearly complete , I cannot change to any other. Need to find a way.

I have attached a file, kindly take a look.

Thanks

Gary.J.S

AttachmentSize
doc2.jpg 97.78 KB
gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 39 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9738
Points: 3817

Be careful

Let him enter only a preset data group. Do not let him have anything to do with the format of the item. Use a straight-forward html form to transfer to data to the server. He should enter only the data that define the item. It is up to your mid-tier php to translate to proper query language to store in the database or return the data as html pages for display.

Don't forget to validate all user supplied content. Never trust the user.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gary4u
gary4u's picture
Offline
Regular
India
Last seen: 11 weeks 13 hours ago
India
Timezone: GMT+5.5
Joined: 2018-12-31
Posts: 15
Points: 23

Sir , Thank you very much for

Sir ,

Thank you very much for your prompt response. I shall do that and also try to not to disturb the codings

Gary.J.S