Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Thursday 24 April 2014

Add image/logo in browser tab for website

How to add image/logo in browser tab for website?

Place the below code under <head> tag in html

<link rel="shortcut icon" href="path to your logo">

Wednesday 23 October 2013

Add horizontal scrollbar to html table

Inorder to add a horizontal scroll bar on html table automatically as the table grows, we need to wrap the table inside a div and add overflow:auto css property

For eg:

<div style="white-space:pre;overflow:auto;width:500px;padding:10px;"> <table style="width:900px;"> <tr> <td>text1</td> <td>text2</td> <td>text3</td> </tr> </table> </div>

Wednesday 4 April 2012

How to Wrap text in a cell of a html table?

Normally wrapping of text happens automatically in HTML tables.But if the text contains no delimiters(like "Thisisatext" instead of  "This is a Text"), word wrapping does not happens.

Below code works even if there is no delimiters in the text.

<table width="700" style="table-layout:fixed" align="left">
<tr>
<td style="word-wrap: break-word;">
</td>
</tr>
</table>