Skip to content

Instantly share code, notes, and snippets.

@jayapal
Last active August 29, 2015 14:07
Show Gist options
  • Save jayapal/711224a1a538be4447cf to your computer and use it in GitHub Desktop.
Save jayapal/711224a1a538be4447cf to your computer and use it in GitHub Desktop.
// js where you add header for the table dynamically
field = "user_type"
field_split = field.split("_")
field_text = field_split.join(" ")
console.log(field_text) // user type
var th = $('<th>', {
text : field_text,
class: "text-capitalize",
})
// css
.text-capitalize {
text-transform:capitalize;
}
So when u render, <th class="text-capitalize"> user type </th>
and in browser, you can see as User Type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment