His father Zhang Tong (張同) served as a Tang dynasty official and at one point reached the position of governor of Rong District (容管, headquartered in modern Yulin, Guangxi).
At that time, an ancient-looking ornate ding was found in a well, that bore, in seal script, the inscription, "Sculpted by Ji Qian [(吉千)] in the spring, the second month, of the first year of Wei's Huangchu [(黃初)] era [(i.e., 220)]."
[1] Late in the Guangming (880-881) era of Emperor Xizong of Tang, the Chang'an region came under attack by the major agrarian rebel Huang Chao.
[1] After spending the time in the wilderness for over a decade, Zhang Ce entered imperial government service and served as a scholar at Guangwen Pavilion (廣文館), and later Mishu Lang (秘書郎), an assistant at the Palace Library.
[1][3] Later, when Wang ran into disputes with the imperial government and was attacked and defeated by Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), Zhang, along with a servant girl, personally bore a litter to put his mother on, so that they could flee Jingnan's capital Bin Prefecture (邠州), through the snow.
After less than a year, the warlord Han Jian the military governor of Zhenguo Circuit (鎮國, headquartered in modern Weinan, Shaanxi) invited Zhang to serve as his secretary, and later, when Han became the military governor of Zhongwu Circuit (忠武, headquartered in modern Xuchang, Henan), Zhang served as chief secretary.
[1] Shortly after, he was made deputy minister of justice (刑部侍郎, Xingbu Shilang) and a chancellor, with the designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事), along with Yu Jing (于兢), replacing Yang She.
[6] He was also put in charge of the directorate of taxation (判戶部, Pan Hubu) and shortly after made Zhongshu Shilang (中書侍郎), the deputy head of the legislative bureau.