HTML table width not working

The problem is, the content inside your table requires more space than 100% of your window-size offers. What you could do, is to use the overflow-property of CSS. Try the following example and chose, wether this is an option for you: <!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <title></title> <style> .table { color: green; display: block; max-width: … Read more

Change table columns order

If you only require to simply move a column without any fancy drag-drop animation, the following JS should do the trick: <script type=”text/javascript”> $(function() { jQuery.each($(“table tr”), function() { $(this).children(“:eq(1)”).after($(this).children(“:eq(0)”)); }); }); </script> Replacing the numbers as necessary. The concept works It seems that writing this as a one liner isn’t really possible. including td … Read more

Create HTML Table with SQL FOR XML

select (select p.ProblemType as ‘td’ for xml path(”), type), (select p.Onset as ‘td’ for xml path(”), type), (select p.DiagnosisStatus as ‘td’ for xml path(”), type) from tblProblemList p where p.PatientUnitNumber = @PatientUnitNumber for xml path(‘tr’) To add the header as well you can use union all. select (select ‘Problem’ as th for xml path(”), type), … Read more

Break a using only CSS

How about using inline-block with a fixed width table… Or using % roughly 45% of width for your td elements so you won’t need to define width for the table Demo Here, am just turning the td to display: inline-block; and because of the fixed width table, they will be forced to wrap to the … Read more

How do I parse an HTML table with Nokogiri?

#!/usr/bin/ruby1.8 require ‘nokogiri’ require ‘pp’ html = <<-EOS (The HTML from the question goes here) EOS doc = Nokogiri::HTML(html) rows = doc.xpath(‘//table/tbody[@id=”threadbits_forum_251″]/tr’) details = rows.collect do |row| detail = {} [ [:title, ‘td[3]/div[1]/a/text()’], [:name, ‘td[3]/div[2]/span/a/text()’], [:date, ‘td[4]/text()’], [:time, ‘td[4]/span/text()’], [:number, ‘td[5]/a/text()’], [:views, ‘td[6]/text()’], ].each do |name, xpath| detail[name] = row.at_xpath(xpath).to_s.strip end detail end pp details … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)